package com.ruoyi.jl.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.ruoyi.jl.domain.Player;
import com.ruoyi.jl.domain.custome.CustomPlayer;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 玩家 数据层
 * 
 * @author wh
 * @date 2019-04-29
 */
public interface PlayerMapper extends BaseMapper<Player> {

    @Select("select * from jl_player t left join jl_game tt on t.player_id = tt.id ${ew.customSqlSegment}")
    List<Player> getAll(@Param(Constants.WRAPPER) QueryWrapper wrapper);

    List<CustomPlayer> list(Player player);

    Integer addGold(Map param);

    Integer reduceGold(Map param);

    CustomPlayer queryEditInfo(Integer playerId);

    Player queryPlayerInfo(Map param);
}